from microbit import *
class TR(object):
    def __init__(self,):
        self.p = {
            'J1': pin1,
            'J2': pin2,
            'J3': pin13,
            'J4': pin15
        }

    def get_analog(self, R):
        v = self.p[R].read_analog()
        v = 0 if v == 1 else v
        return v

trimpot = TR()